package d12_stringbuilder;

public class Test3{
    public static void main(String[] args) {
        System.out.println(getArrayData(new int[]{11, 22, 33, 44, 55}));
    }

    public static String getArrayData(int[] arr){
        if (arr == null){
            return null;
        }
        StringBuilder s = new StringBuilder("[");
        for (int i = 0; i < arr.length; i++) {
            if(i==(arr.length-1)){
                s.append(arr[i]);
            }else{
                s.append(arr[i]).append(", ");
            }
        }
        s.append("]");
        return s.toString();
    }
}
